<template>
    <div class="skill-container">
        <ul class="imgtextlist skill-list">
            <li v-for="item in skillList" :key="item.summoner_id" @click="skillClickHandle(item.summoner_id)" :class="item == skillItem ? 'current' : ''">
                <img :src="'https://game.gtimg.cn/images/yxzj/img201606/summoner/' + item.summoner_id + '.jpg'">
                <p>{{ item.summoner_name }}</p>
            </li>
        </ul>
        <div class="skill-detail">
            <div class="skill-title">
                <img v-if="skillItem.summoner_id != undefined"
                    :src="'https://game.gtimg.cn/images/yxzj/img201606/summoner/' + skillItem.summoner_id + '-big.jpg'">
                <h4>{{ skillItem.summoner_name }}</h4>
                <p class="level-lock">{{ skillItem.summoner_rank }}</p>
            </div>
            <div class="skill-desc">
                {{ skillItem.summoner_description }}
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            skillList: "",
            skillNewList: "",
            radio: 0,
            skillItem: {
                "summoner_id": 80104,
                "summoner_name": "惩击",
                "summoner_rank": "LV.1解锁",
                "summoner_description": "30秒CD：对身边的野怪和小兵造成真实伤害并眩晕1秒"
            }
        }
    },
    created() {
        this.query();
    },
    methods: {
        query() {
            this.axios.get('http://47.241.102.141:3000/summoners')
                .then(response => {
                    this.skillList = response.data;
                    this.skillNewList = this.skillList;
                })
                .catch(error => {
                    console.log(error);
                });
        },
        skillClickHandle(id) {
            for (let i = 0; i < this.skillList.length; i++) {
                if (this.skillList[i].summoner_id == id) {
                    this.skillItem = this.skillList[i];
                }
            }
        }
    },
}
</script>

<style>
body>.el-container {
    margin-bottom: 40px;
    height: 100%;
}

.skill-container {
    width: 1140px;
    height: 485px;
    margin: 0 auto;
    padding: 35px 28px;
}

.skill-list {
    float: left;
    width: 43%;
    margin-right: 0;
    border-right: 1px solid #F0F0F0;
}

.imgtextlist {
    float: left;
    padding: 30px 0 0;
    margin-left: -14px;
    margin-right: -20px;
    position: relative;
}

li {
    display: list-item;
}

.imgtextlist li {
    float: left;
    width: 116px;
    height: 120px;
    margin-bottom: 22px;
    text-align: center;
    line-height: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.imgtextlist img {
    display: block;
    margin: 0 auto 7px;
    width: 85px;
    height: 85px;
    border-radius: 10px 0 10px 0;
    border: 3px solid #1E84E7;
}

.imgtextlist .current {
    color: #00A383;
}

.imgtextlist .current img {
    border: 3px solid #00A383;
}

.skill-detail {
    float: left;
    width: 50%;
    padding-top: 30px;
    padding-left: 56px;
}

.skill-title {
    overflow: hidden;
    zoom: 1;
}

/* h4 {
    display: block;
    margin-block-start: 1.33em;
    margin-block-end: 1.33em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
} */

.skill-title h4 {
    float: left;
    width: 60%;
    font-size: 16px;
    color: #00A383;
    line-height: 30px;
}

.skill-title .level-lock {
    float: left;
    width: 60%;
    color: #9A9A9A;
    line-height: 30px;
    font-size: 14px;
}

.skill-desc {
    padding: 20px 0;
    line-height: 18px;
    color: #333;
    font-size: 14px;
}
</style>